<?php
class GiftcardModel extends Eloquent {
    protected $table = 'giftcard';
    protected $primaryKey  = 'giftcard_id';
    protected $appends = array(
        'is_expire'
    );
    public function getIsExpireAttribute($value){
        if (strtotime($this->expire_at) >= time()) {
            return 0;
        } else {
            return 1;
        }

    }
}


